<?php

function get_user_info($name,$type = 1){
	if($type){
		echo session("user.$name");
	}else{
		return session("user.$name");
	}
}


function uid($type = 0){
	return get_user_info('id',$type);
}

function uinfo(){
	return session('user');
}

function uname($type = 0){
	return get_user_info('uname',$type)?get_user_info('uname',$type):get_user_info('account',$type);
}